#!/usr/bin/python

import sys
import bsddb

if __name__ == "__main__":
 
    genom_db_fname = sys.argv[1]

    cnt_all = 0
    cnt_genes = 0
    genom_db = bsddb.hashopen(genom_db_fname, 'w')
    keys = sorted(genom_db.iterkeys())
    for locus in keys:
        genom = genom_db[locus]
        sys.stdout.write("%s\t%s\n" % (locus, genom))
        cnt_genes += 1
    genom_db.close()

    print >> sys.stderr, "Done! (%s)" % (cnt_genes)

